// Data.java

package com.ruoyi.service.entity.order.process;

import com.ruoyi.service.domain.ServiceOrders;
import com.ruoyi.service.domain.ServiceUsers;
import com.ruoyi.service.entity.order.*;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.List;

@lombok.Data
public class PCOrderProcessRet {
    private Long orderId;
    private String orderIdVO;
    private String orderPayId;

    private String orderCreateTime;
    private String orderPayTime;

    private PCAppointmentInfo userInfo;

    private PCServeInfo serveInfo;

    private List<PCNurseInfo> nurseInfo;

    //private PCOrderDetailInfo orderInfo;
    private List<PCProcessItems> items;

    private List<PCOrderProcess> process;


    public void init(ServiceOrders order) {
        this.orderId = order.getOrderId();
        this.orderIdVO = order.getOrderCode();
        DateFormat cstFormate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String creatTimeNew = cstFormate.format(order.getOrderCreateTime());
        this.orderCreateTime = creatTimeNew;

        if(this.userInfo == null){
            this.userInfo = new PCAppointmentInfo();
        }
        this.userInfo.setAppointmentDesc(order.getOrderRemark());
    }


    public void initUserInfo(ServiceUsers userInfo) {
        if(this.userInfo == null){
            this.userInfo = new PCAppointmentInfo();
        }
        this.userInfo.setAppointmentId(userInfo.getUsersId());
        this.userInfo.setAppointmentName(userInfo.getUsersName());
        this.userInfo.setAppointmentTel(userInfo.getUsersTelephone());
    }

    public void initOrderItem(List<PCProcessItems> items) {
        this.items = items;
    }

    public void initProcess(List<PCOrderProcess> process) {
        this.process = process;
    }

    //public void initOrderInfo(PCPaidInfo paidInfo) {
    //
    //    PCOrderDetailInfo info = new PCOrderDetailInfo();
    //    info.init(paidInfo.getActual(), paidInfo.getPrePaid(), paidInfo.getDifference());
    //    this.orderInfo = info;
    //
    //}
}